﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ItemsMultilang.aspx.cs" Inherits="WebService.Admin.ItemsMultilang" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Item Multilang Page - GPS Travel</title>
    <style type="text/css">
        .style1
        {
            width: 1633px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table style="width:100%;">
            <tr>
                <td>
                    &nbsp;</td>
                <td class="style1">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td style="font-weight: 700" class="style1">
                    Item List 
| Go to
                    <asp:HyperLink ID="HyperLink6" runat="server" NavigateUrl="~/Admin/Item.aspx" 
                        style="text-align: right">ItemList Page</asp:HyperLink>
&nbsp;| Go to
                    <asp:HyperLink ID="HyperLink3" runat="server" 
                        NavigateUrl="~/Admin/Category.aspx" style="text-align: right">CategoryList Page</asp:HyperLink>
&nbsp;
| Go to
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Admin/ListPlaces.aspx" 
                        style="text-align: right">ListPlaces Page</asp:HyperLink>
&nbsp;| Go to
                    <asp:HyperLink ID="HyperLink5" runat="server" 
                        NavigateUrl="~/Admin/DeviceItem.aspx" style="text-align: right">Device List Page </asp:HyperLink>
&nbsp;| Go to
                    <asp:HyperLink ID="HyperLink2" runat="server" 
                        NavigateUrl="~/Admin/DeviceHistory.aspx" style="text-align: right">DeviceHistory Page</asp:HyperLink>
&nbsp;| Go to
                    <asp:HyperLink ID="HyperLink7" runat="server" 
                        NavigateUrl="~/Admin/CategoryMultilang.aspx" style="text-align: right">Category Multilang Page</asp:HyperLink>
&nbsp;| Go to
                    <asp:HyperLink ID="HyperLink8" runat="server" 
                        NavigateUrl="~/Admin/Languages.aspx" style="text-align: right">Language Page</asp:HyperLink>
&nbsp;| Return
                    <asp:HyperLink ID="HyperLink4" runat="server" 
                        NavigateUrl="~/Admin/Default.aspx" style="text-align: right">Admin Page</asp:HyperLink>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td class="style1">
                    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1"
            onsorting="ListView1_Sorting"  InsertItemPosition="LastItem" 
            onitemcommand="ListView1_ItemCommand">
            <LayoutTemplate>
                <table border="0" cellpadding="1">
                    <tr style="background-color:#E5E5FE">
                        <th align="left"><asp:LinkButton ID="LinkId" runat="server" CommandName="Sort" CommandArgument="Id">Id</asp:LinkButton></th>
                        <th align="left"><asp:LinkButton ID="lnkItemID" runat="server" CommandName="Sort" CommandArgument="ItemName">Item Name</asp:LinkButton></th>
                        <th align="left"><asp:LinkButton ID="lnkAddress" runat="server" CommandName="Sort" CommandArgument="Address">Address</asp:LinkButton></th>
                        <th align="left"><asp:LinkButton ID="lnkNote" runat="server" CommandName="Sort" CommandArgument="Note">Note</asp:LinkButton></th>
                        <th align="left"><asp:LinkButton ID="lnkLanguage" runat="server" CommandName="Sort" CommandArgument="Language">Language</asp:LinkButton></th>
                        <th align="left"><asp:LinkButton ID="lnkIsDefault" runat="server" CommandName="Sort" CommandArgument="IsDefault">Default</asp:LinkButton></th>
                        <th align="left"><asp:LinkButton ID="lnkItemName" runat="server" CommandName="Sort" CommandArgument="ItemName1">ItemName</asp:LinkButton></th>
                        <th align="left"><asp:LinkButton ID="lnkAddress1" runat="server" CommandName="Sort" CommandArgument="Address1">Address</asp:LinkButton></th>
                        <th align="left"><asp:LinkButton ID="lnkNote1" runat="server" CommandName="Sort" CommandArgument="Note1">Note</asp:LinkButton></th>
                        
                        <th></th>
                    </tr>
                    <tr id="itemPlaceholder" runat="server"></tr>
                </table>
                <asp:DataPager ID="ItemDataPager" runat="server" PageSize="20">
                    <Fields>
                        <asp:NumericPagerField ButtonCount="10" />
                    </Fields>
                </asp:DataPager>    
            </LayoutTemplate>
            <ItemTemplate>
                    <tr>
                        <td><asp:Label runat="server" ID="lblId"><%#Eval("ID")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblName"><%#Eval("ItemName")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblAddress"><%#Eval("Address")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblNote"><%#Eval("Note")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblLanguage"><%#Eval("Language")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblIsDefault"><%#Eval("IsDefault")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblItemName1"><%#Eval("ItemName1")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblAddress1"><%#Eval("Address1")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblNote1"><%#Eval("Note1")%></asp:Label></td>
                        <td><asp:LinkButton ID="lnkEdit" runat="server" CommandName="Edit">Edit</asp:LinkButton></td>
                    </tr>
            </ItemTemplate>
            <AlternatingItemTemplate>
                    <tr style="background-color:#EFEFEF">
                        <td><asp:Label runat="server" ID="lblId"><%#Eval("ID")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblName"><%#Eval("ItemName")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblAddress"><%#Eval("Address")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblNote"><%#Eval("Note")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblLanguage"><%#Eval("Language")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblIsDefault"><%#Eval("IsDefault")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblItemName1"><%#Eval("ItemName1")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblAddress1"><%#Eval("Address1")%></asp:Label></td>
                        <td><asp:Label runat="server" ID="lblNote1"><%#Eval("Note1")%></asp:Label></td>
                        <td><asp:LinkButton ID="lnkEdit" runat="server" CommandName="Edit">Edit</asp:LinkButton></td>
                    </tr>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                    <td>
                        <asp:TextBox ID="txtUpId" runat="server" Text='<%#Eval("ID") %>' Enabled="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="txtUpItem" runat="server" Text='<%#Eval("ItemName") %>' Enabled="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="txtUpAddress" runat="server" Text='<%#Eval("Address") %>' Enabled="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="txtUpNote" runat="server" Text='<%#Eval("Note") %>' Enabled="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="txtUpLanguage" runat="server" Text='<%#Eval("Language") %>' Enabled="false" Width="100px"></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="txtUpIsDefault" runat="server" Text='<%#Eval("IsDefault") %>'></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="txtUpName" runat="server" Text='<%#Eval("ItemName1") %>'></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="txtUpAdd" runat="server" Text='<%#Eval("Address1") %>'></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="txtUpNotee" runat="server" Text='<%#Eval("Note1") %>' Enabled="false"></asp:TextBox>
                    </td>                    
                     <td>   
                            <asp:LinkButton ID="lnkUpdate" runat="server" CommandName="Update">Update</asp:LinkButton>
                            <asp:LinkButton ID="lnkDelete" runat="server" CommandName="Delete">Delete</asp:LinkButton>
                            <asp:LinkButton ID="lnkCancel" runat="server" CommandName="Cancel">Cancel</asp:LinkButton>
                    </td>
                    
                </tr>
            </EditItemTemplate>
            <InsertItemTemplate>
                <tr id="Tr1" runat="server">
                    <td></td>
                    <td>
                        <asp:DropDownList ID="ddlUpItem" runat="server" DataSourceID="SqlDataSource2" DataTextField="ItemName" DataValueField="ItemID" Width="200px" OnSelectedIndexChanged="ddlUpItem_SelectedIndexChanged"></asp:DropDownList>
                    </td>
                    <td>
                        <asp:TextBox ID="txtAddress" runat="server" Text='' Enabled="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="txtNote" runat="server" Text='' Enabled="false"></asp:TextBox>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlUpLanguage" runat="server" DataSourceID="SqlDataSource3" DataTextField="LangName" DataValueField="Language" Width="100px"></asp:DropDownList>
                    </td>
                    <td>
                        <asp:TextBox ID="txtIsDefault" runat="server" Text='<%#Eval("IsDefault") %>' ></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="txtName" runat="server" Text='<%#Eval("ItemName1") %>' ></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="txtAdd" runat="server" Text='<%#Eval("Address1") %>' ></asp:TextBox>
                    </td>
                     <td>
                        <asp:TextBox ID="txtNotee" runat="server" Text='<%#Eval("Note1") %>' ></asp:TextBox>
                    </td>                     
                     <td><asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" /></td>
                    
                </tr>
            </InsertItemTemplate>
            
        </asp:ListView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:GPSTravelConnect %>" 
            SelectCommand="Select ID ,a.[ItemID], a.[ItemName] as ItemName, b.[ItemName] as ItemName1,[CategoryID],[Rate], a.[Address] as Address, b.[Address] as Address1,[Phone],[Email],a.[Note] as Note, b.[Note] as Note1,[X],[Y],[Image], [Language], [IsDefault] From tbl_Items a, tbl_ItemsTranslation b Where a.ItemID=b.ItemID" >
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:GPSTravelConnect %>" 
            SelectCommand="SELECT * FROM [tbl_Items]" >
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
            ConnectionString="<%$ ConnectionStrings:GPSTravelConnect %>" 
            SelectCommand="SELECT * FROM [tbl_Languages]" >
        </asp:SqlDataSource>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td class="style1">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
